package cz.anime.ppro.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * The persistent class for the content database table.
 * 
 */
@Entity
public class Content implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;

	private String content;

	@Temporal(TemporalType.DATE)
	private Date date;

	private String type;

	//bi-directional many-to-one association to Comment
	@OneToMany(mappedBy="content")
	private List<Comment> comments;

	//bi-directional many-to-one association to Fragment
	@ManyToOne
	@JoinColumn(name="fragment_id")
	private Fragment fragment;

	//bi-directional many-to-one association to Rss
	@OneToMany(mappedBy="content")
	private List<Rss> rsses;

	public Content() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public List<Comment> getComments() {
		return this.comments;
	}

	public void setComments(List<Comment> comments) {
		this.comments = comments;
	}

	public Fragment getFragment() {
		return this.fragment;
	}

	public void setFragment(Fragment fragment) {
		this.fragment = fragment;
	}

	public List<Rss> getRsses() {
		return this.rsses;
	}

	public void setRsses(List<Rss> rsses) {
		this.rsses = rsses;
	}

}